package com.juyu.miliao.common.util;

import com.juyu.miliao.common.exception.ConsumeRuntimeException;

/**
 * @author jh
 * @date 2019/09/17
 */
public class CheckSqlResultUtil {

    private CheckSqlResultUtil() {
    }

    /**
     * 验证数据,抛出异常 用于事务
     *
     * @param result result
     */
    public static void checkResult(int result) {
        if (result <= 0) {
            throw new ConsumeRuntimeException("保存或更新失败");
        }
    }
}
